package com.globalresources.po;

/**
 * Relation entity.
 * 
 * @author MyEclipse Persistence Tools
 */

public class Relation implements java.io.Serializable {

	// Fields

	private Integer id;
	private User user;
	private Authority authority;

	// Constructors

	/** default constructor */
	public Relation() {
	}

	/** full constructor */
	public Relation(User user, Authority authority) {
		this.user = user;
		this.authority = authority;
	}

	// Property accessors

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Authority getAuthority() {
		return this.authority;
	}

	public void setAuthority(Authority authority) {
		this.authority = authority;
	}
	
	@Override
	public String toString() {
		StringBuffer re = new StringBuffer("relation:");
		re.append("[id="+id+"],");
		re.append("[user="+user.getUsername()+"]");
		re.append("[authority="+authority.getAuthority()+"]");
		return re.toString();
	}

}